﻿@model SYTradingPublicSite.ViewModels.GloveViewModel

@{
    ViewBag.Title = "Gloves";
}

<div class="container-fluid GlovePage">
    <div class="row-fluid">
        <div class="span3">
            @Html.Partial("SidebarNav")
        </div>
        <!--/span-->
        <div class="span9">
            @if (!string.IsNullOrEmpty(Model.selectedApplicationCategory))
            {
                <h3>Gloves for @Model.selectedApplicationCategory</h3>
            }
            @if (Model.Materials.Where(c => c.MaterialID == Model.selectedMaterialID).Count() == 1)
            {
                <h3>@Model.Materials.Where(c => c.MaterialID == Model.selectedMaterialID).Single().Name Gloves</h3>
            } 

            @if (Model.Gloves.Count == 0)
            {
                <h4>Sorry! There is no glove for this category at this moment.</h4>
            }

            @for (int i = 0; i < Model.Gloves.Count; i++)
            {
                SYTradingPublicSite.Models.Glove glove = Model.Gloves[i];

                if ((i + 1) % 3 == 1)
                {
                    @: <div class="row-fluid show-grid">
                }   
                        @: <div class="span4">
                            if (glove.ImagePaths.Count > 0)
                            {
                                <img src="@glove.ImagePaths.First().Path?thumbnail=true" class="img-polaroid" />
                            }
                            <h4>@glove.ItemNo</h4>
                            <h4 class="hidden-phone">@glove.Name</h4>
                            <p class="hidden-phone">@glove.Description</p>
                            <p class="hidden-phone"><a class="btn" href="@Url.Action("Details", new { id=glove.GloveID, selectedApplicationCategory=Model.selectedApplicationCategory, selectedMaterialID=Model.selectedMaterialID })"><span>View details</span> &raquo;</a></p>
                        @: </div>

                            if ((i + 1) % 3 == 0 || i + 1 == Model.Gloves.Count)
                            {
                    @: </div>
                            }
            }
        </div>
        <!--/span-->
    </div>
    <!--/row-->
</div>
<!--/.fluid-container-->
